package baiqi.sishen.community.enums;

/**
 * 评论问题 或 二级评论
 *
 * @author 兕神
 * @version 1.0
 * DateTime: 2023/5/1
 */

public enum CommentTypeEnum {
    QUESTION(0),
    COMMENT(1);

    private Integer type;

    CommentTypeEnum(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    //用于判断type是否属于该列举类型之一：是TRUE
    public static boolean isExist(Integer type) {
        for (CommentTypeEnum value : CommentTypeEnum.values()) {
            if (value.getType().equals(type)) {
                return true;
            }
        }
        return false;
    }
}
